﻿@{
    //Layout = null;
    Layout = "~/Views/Shared/MainLayout.cshtml";
    ViewBag.Title =Model.CategoryName+ "列表";
}
@model ConvertMediaPro.Models.ContentViewModelList

@*<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/bootstrap.css" rel="stylesheet" />
    <script src="~/Scripts/bootstrap.js"></script>
    <title>ContentList</title>
</head>
<body>
    <div class="container">
        <br />
        
    </div>
</body>
</html>*@
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
<div class="row">
    <div class="col-md-10">
        @if (Model.ContentId > 0)
        {
            var cateName = "预览" + Model.CategoryName + "的内容";
            <a href="/Read/Content/@Model.CategoryId" class="btn btn-primary">@cateName</a>
        }
        else
        {
            var cateName = "请添加" + Model.CategoryName + "的内容";
            <a href="javascript:void(0)" class="btn btn-primary">@cateName</a>
        }
    </div>
    <div class="col-md-1">
        <a href="/Read/Index/@Model.CategoryId" class="btn btn-primary">添加</a>
    </div>
    <div class="col-md-1">
        <a href="/Category/Index" class="btn btn-primary">返回</a>
    </div>
</div>
<br />
<div class="row">
    <div class="col-md-12">
        <table class="table table-condensed">
            <thead>
                <tr>
                    <th class="col-md-4">标题</th>
                    <th class="col-md-2">创建时间</th>
                    <th class="col-md-2">最后修改时间</th>
                    <th class="col-md-4">操作</th>
                </tr>
            </thead>
            <tbody>
                @{
                    foreach (Model.Content item in Model.ContentList)
                    {
                        <tr class="active">
                            <th class="col-md-4">@item.Title</th>
                            <td class="col-md-2">@item.CreateTime</td>
                            <td class="col-md-2">@item.LastUpdateTime</td>
                            <td class="col-md-4">
                                <a href="/Read/Detail?contentId=@item.ContentId">查看详情</a>|
                                <a href="/Read/Update?contentId=@item.ContentId">修改</a>|
                                @*@Ajax.ActionLink("删除", "Delete", new { contentId = item.ContentId }, new AjaxOptions()
                                    {
                                        Confirm="确定删除？"
                                    })*@
                                <a href="/Read/Delete?contentId=@item.ContentId&categoryId=@Model.CategoryId">删除</a>
                            </td>
                        </tr>
                    }
                }
            </tbody>
        </table>
    </div>
</div>


